﻿using YDT_SeckillService.Applictions.DTOs;

namespace YDT_SeckillService.Applictions.Interfaces
{
    /// <summary>
    /// 秒杀应用服务接口 - 定义秒杀业务操作
    /// </summary>
    public interface ISeckillService
    {
        /// <summary>根据ID获取秒杀活动</summary>
        Task<SeckillDto?> GetSeckillByIdAsync(Guid id);
        /// <summary>根据日期获取秒杀活动</summary>
        Task<IEnumerable<SeckillDto>> GetSeckillsByDateAsync(DateOnly date);
        /// <summary>获取所有秒杀活动</summary>
        Task<IEnumerable<SeckillDto>> GetAllSeckillsAsync();
        /// <summary>获取正在进行中的秒杀活动</summary>
        Task<IEnumerable<SeckillDto>> GetActiveSeckillsAsync();
        /// <summary>获取即将开始的秒杀活动</summary>
        Task<IEnumerable<SeckillDto>> GetUpcomingSeckillsAsync();
        /// <summary>分页查询秒杀活动</summary>
        Task<(IEnumerable<SeckillDto> Seckills, int TotalCount)> GetPagedSeckillsAsync(SeckillQueryDto query);
        /// <summary>创建秒杀活动</summary>
        Task<SeckillDto> CreateSeckillAsync(CreateSeckillDto createSeckillDto);
        /// <summary>更新秒杀活动</summary>
        Task<SeckillDto?> UpdateSeckillAsync(Guid id, UpdateSeckillDto updateSeckillDto);
        /// <summary>删除秒杀活动</summary>
        Task<bool> DeleteSeckillAsync(Guid id);
        /// <summary>启用秒杀活动</summary>
        Task<SeckillDto?> EnableSeckillAsync(Guid id);
        /// <summary>禁用秒杀活动</summary>
        Task<SeckillDto?> DisableSeckillAsync(Guid id);
        /// <summary>添加秒杀商品</summary>
        Task<SeckillDto?> AddSeckillProductAsync(Guid seckillId, CreateSeckillProductDto productDto);
        /// <summary>移除秒杀商品</summary>
        Task<SeckillDto?> RemoveSeckillProductAsync(Guid seckillId, Guid seckillProductId);
        /// <summary>减少秒杀商品库存</summary>
        Task<SeckillProductDto?> DecreaseSeckillProductStockAsync(Guid seckillProductId, int quantity);
    }
}
